package com.ztf666.service;


import org.elasticsearch.index.query.Operator;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;

/**
 * @Author ztf
 * @Date 21:47 2022/1/17
 **/
public interface QueryService {
    void termQuery(String index, String filed, String value) throws Exception;

    void termsQuery(String index, String filed, String... value) throws Exception;

    void matchAll(String index) throws Exception;

    void match(String index, String field, String value) throws Exception;

    void boolMatch(String index, String field, String value, Operator operator) throws Exception;

    void multiMacth(String index, String value, String... fields) throws Exception;

    void idQuery(String index, String id) throws Exception;

    void idsQuery(String index, String... ids) throws Exception;

    void prefixQuery(String index, String field, String prefix) throws Exception;

    void fuzzyQuery(String index, String field, String value, int prefix_length) throws Exception;

    void wildcardQuery(String index, String field, String value) throws Exception;

    void rangeQuery(String index, String field, long gte, long lte) throws Exception;

    void regQuery(String index, String field, String reg) throws Exception;

    String createScrollQuery(String index, QueryBuilder queryBuilder, int size) throws Exception;

    void srollQuery(String scrollId) throws Exception;

    void clearScroll(String index, String scrollId) throws Exception;

    void deleteByQuery(String index, QueryBuilder queryBuilder) throws Exception;

    void boostQuery(String index, QueryBuilder queryBuilder, QueryBuilder boostBuilder, float boost) throws Exception;

    void highLight(String index, QueryBuilder queryBuilder, HighlightBuilder highlightBuilder) throws Exception;

    void cardinalityAgg(String index, String field) throws Exception;

    void rangeAgg(String index, AggregationBuilder aggregationBuilder) throws Exception;

    void dateRangeAgg(String index, AggregationBuilder aggregationBuilder) throws Exception;

    void ipRangeAgg(String index, AggregationBuilder aggregationBuilder) throws Exception;

    void extendedStats(String index, String field) throws Exception;
}
